/**   
 * 项目名：phms3
 * 日期：    2019-12-01 17:02:29  
 * Copyright (c) 2015- HTSC-版权所有     
 */

package com.joysuch.wwyt.bp.entity;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Entity
@Table(name = "wwyt_bp_store_area")
@SQLDelete(sql = "update wwyt_bp_store_area set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_store_area set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")

public class BpStoreArea implements java.io.Serializable {

    // columns START
    // ID
    private Long id;
    // 租户
    private Long tenentId;
    // 组织机构代码
    private String orgCode;
    // 装置编号
    private String code;
    // 装置名称
    private String name;
    //
    private Double surrSafetyDistance;
    //
    private Double surrEquipmentDistance;
    // 创建时间
    private java.time.LocalDateTime createTime;
    // 装置位置
    private String location;
    // 设备型号
    private String envFunctionArea;
    // 装置功能
    private Double storeaAreaSize;
    // 装置状态
    private Double nearbyStoreHouseMinDistance;
    // 所属重大危险源单元
    private Long majorHazardId;
    // 所属重大危险源单元编号
    private String majorHazardUnitCode;
    // 创建人
    private Long createBy;
    // 更新人
    private Long updateBy;
    // 更新时间
    private java.time.LocalDateTime updateTime;
    // 删除标记
    private String deleteFlag;
    // columns END

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }

    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }

    @Column(name = "CODE", length = 30)
    public String getCode() {
        return this.code;
    }

    public void setCode(String value) {
        this.code = value;
    }

    @Column(name = "NAME", length = 30, nullable = false)
    public String getName() {
        return this.name;
    }

    public void setName(String value) {
        this.name = value;
    }

    @Column(name = "SURR_SAFETY_DISTANCE")
    public Double getSurrSafetyDistance() {
        return this.surrSafetyDistance;
    }

    public void setSurrSafetyDistance(Double value) {
        this.surrSafetyDistance = value;
    }

    @Column(name = "SURR_EQUIPMENT_DISTANCE")
    public Double getSurrEquipmentDistance() {
        return this.surrEquipmentDistance;
    }

    public void setSurrEquipmentDistance(Double value) {
        this.surrEquipmentDistance = value;
    }

    @org.springframework.data.annotation.CreatedDate
    @Column(name = "CREATE_TIME")
    public java.time.LocalDateTime getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(java.time.LocalDateTime value) {
        this.createTime = value;
    }

    @Column(name = "LOCATION", length = 128)
    public String getLocation() {
        return this.location;
    }

    public void setLocation(String value) {
        this.location = value;
    }

    @Column(name = "ENV_FUNCTION_AREA", length = 100)
    public String getEnvFunctionArea() {
        return this.envFunctionArea;
    }

    public void setEnvFunctionArea(String value) {
        this.envFunctionArea = value;
    }

    @Column(name = "STOREA_AREA_SIZE")
    public Double getStoreaAreaSize() {
        return this.storeaAreaSize;
    }

    public void setStoreaAreaSize(Double value) {
        this.storeaAreaSize = value;
    }

    @Column(name = "NEARBY_STORE_HOUSE_MIN_DISTANCE")
    public Double getNearbyStoreHouseMinDistance() {
        return this.nearbyStoreHouseMinDistance;
    }

    public void setNearbyStoreHouseMinDistance(Double value) {
        this.nearbyStoreHouseMinDistance = value;
    }

    @Column(name = "MAJOR_HAZARD_UNIT_CODE", length = 20)
    public String getMajorHazardUnitCode() {
        return this.majorHazardUnitCode;
    }

    @Column(name = "MAJOR_HAZARD_ID")
    public Long getMajorHazardId() {
        return majorHazardId;
    }

    public void setMajorHazardId(Long majorHazardId) {
        this.majorHazardId = majorHazardId;
    }

    public void setMajorHazardUnitCode(String value) {
        this.majorHazardUnitCode = value;
    }

    @org.springframework.data.annotation.CreatedBy
    @Column(name = "CREATE_BY")
    public Long getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(Long value) {
        this.createBy = value;
    }

    @org.springframework.data.annotation.LastModifiedBy
    @Column(name = "UPDATE_BY")
    public Long getUpdateBy() {
        return this.updateBy;
    }

    public void setUpdateBy(Long value) {
        this.updateBy = value;
    }

    @org.springframework.data.annotation.LastModifiedDate
    @Column(name = "UPDATE_TIME")
    public java.time.LocalDateTime getUpdateTime() {
        return this.updateTime;
    }

    public void setUpdateTime(java.time.LocalDateTime value) {
        this.updateTime = value;
    }

    @Column(name = "DELETE_FLAG", length = 2)
    public String getDeleteFlag() {
        return this.deleteFlag;
    }

    public void setDeleteFlag(String value) {
        this.deleteFlag = value;
    }

    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
                .append("tenentId", getTenentId()).append("orgCode", getOrgCode()).append("code", getCode())
                .append("name", getName()).append("surrSafetyDistance", getSurrSafetyDistance())
                .append("surrEquipmentDistance", getSurrEquipmentDistance()).append("createTime", getCreateTime())
                .append("location", getLocation()).append("envFunctionArea", getEnvFunctionArea())
                .append("storeaAreaSize", getStoreaAreaSize())
                .append("nearbyStoreHouseMinDistance", getNearbyStoreHouseMinDistance())
                .append("majorHazardUnitCode", getMajorHazardUnitCode()).append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy()).append("updateTime", getUpdateTime())
                .append("deleteFlag", getDeleteFlag()).toString();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(getId()).toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpStoreArea == false)
            return false;
        if (this == obj)
            return true;
        BpStoreArea other = (BpStoreArea) obj;
        return new EqualsBuilder().append(getId(), other.getId()).isEquals();
    }
}
